<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>酒店信息系统</title>
<LINK rel=stylesheet href="__PUBLIC__/css/style.css">
<link type="text/css" rel="stylesheet" href="__PUBLIC__/css/page.css" />
<script src="__PUBLIC__/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script language="javascript">
function addad(){
	var name = $("#name").val();
	var url = $("#url").val();
	var mname = $("#mname").val();

	if(name==''){
		alert('请填写广告名称');
		return false;
	}

	$.post("__APP__/system/addad",{
		name : name,
		url : url,
		mname : mname
	}, function(data) {
		if(data.msg=="1"){
			alert("添加成功");
			location.reload();
		}else if(data.msg=="2"){
			alert("所属目录不存在");
			$('#mname').val("");
		}else{
			alert("添加失败");
		}
	},"json");
}
function add(){
	$("#show").show();
}


function editad(){
	var x = $("#x").val();

    if ( $("#nameempty").html() =='空房是否收费')
    {
        /*
         var chk_value =[];
         $('input[name="radiobutton"]:checked').each(function(){
         chk_value.push($(this).val());
         });
         x = chk_value.length==0 ?0:chk_value;
         */
        alert('此项目不可修改');
    }else{
        var y = $("#y").val();
        var id= $("#id").val();

        $.post("__APP__/system/editcanshu",{
             id: id,
             x : x,
             y : y
         }, function(data) {
             if(data.msg=="1"){
                 alert("编辑成功");
                 location.reload();
             }else{
                 alert("编辑失败");
             }
         },"json");
    }
}
function edit(name,x,y,id){
	if (name == '空房是否收费'){
		/*
		$("#editempty").show();
		$("#nameempty").html(name);
		$("#x").val(x);
		$("#id").val(id);
		*/
		alert('此项目不可修改');
	}else if(name=='电脑选择'){
		$("#editandriod").show();
		$("#andriodname").html(name);
		$("#andriod").val(x);
		$("#id").val(id);
	}else if(name=='电视消息'){
		$("#editds").show();
		$("#dsname").html(name);
		$("#ds").val(x);
		$("#id").val(id);
	}else if(name=='开机动画'){
		$("#editkaiji").show();
		$("#kaijiname").html(name);
		$("#kaiji").val(x);
		$("#id").val(id);
	}else if(name=='模版选择'){
		$("#editmuban").show();
		$("#mubanname").html(name);
		$("#muban").val(x);
		$("#id").val(id);
	}else if(name=='开房选择'){
		$("#editkf").show();
		$("#kfname").html(name);
		$("#kf").val(x);
		$("#id").val(id);
	}else if(name=='频道选择'){
		$("#editpd").show();
		$("#pdname").html(name);
		$("#pd").val(x);
		$("#id").val(id);
	}else if(name=='天气选择'){
		$("#editweather").show();
		$("#weathername").html(name);
		$("#weather").val(x);
		$("#id").val(id);
	}else if(name=='logo选择'){
		$("#editlogo").show();
		$("#logoname").html(name);
		$("#logo").val(x);
		$("#id").val(id);
	}else if(name=='酒店留言滚动'){
		$("#editlygd").show();
		$("#lygdname").html(name);
		$("#lygd").val(x);
        $("#ltypes").val(y);
		$("#id").val(id);
	}else{
		$("#edit").show();
		$("#name").html(name);
		$("#x").val(x);
		$("#y").val(y);
		$("#id").val(id);
	}
}
function addmuban(){
	var x = $("#muban").val();
	var y = '';
	var id= $("#id").val();
	$.post("__APP__/system/editcanshu",{
		id: id,
		x : x,
		y : y
	}, function(data) {
		if(data.msg=="1"){
			alert("编辑成功");
			location.reload();
		}else{
			alert("编辑失败");
		}
	},"json");
}
function addmuban1(){
	var x = $("#kf").val();
	var y = '';
	var id= $("#id").val();
	$.post("__APP__/system/editcanshu",{
		id: id,
		x : x,
		y : y
	}, function(data) {
		if(data.msg=="1"){
			alert("编辑成功");
			location.reload();
		}else{
			alert("编辑失败");
		}
	},"json");
}
function addmuban2(){
	var x = $("#pd").val();
	var y = '';
	var id= $("#id").val();
	$.post("__APP__/system/editcanshu",{
		id: id,
		x : x,
		y : y
	}, function(data) {
		if(data.msg=="1"){
			alert("编辑成功");
			location.reload();
		}else{
			alert("编辑失败");
		}
	},"json");
}
function addmuban3(){
	var x = $("#kaiji").val();
	var y = '';
	var id= $("#id").val();
	$.post("__APP__/system/editcanshu",{
		id: id,
		x : x,
		y : y
	}, function(data) {
		if(data.msg=="1"){
			alert("编辑成功");
			location.reload();
		}else{
			alert("编辑失败");
		}
	},"json");
}
function addmuban4(){
	var x = $("#andriod").val();
	var y = '';
	var id= $("#id").val();
	$.post("__APP__/system/editcanshu",{
		id: id,
		x : x,
		y : y
	}, function(data) {
		if(data.msg=="1"){
			alert("编辑成功");
			location.reload();
		}else{
			alert("编辑失败");
		}
	},"json");
}
function addmuban5(){
	var x = $("#ds").val();
	var y = '';
	var id= $("#id").val();
	$.post("__APP__/system/editcanshu",{
		id: id,
		x : x,
		y : y
	}, function(data) {
		if(data.msg=="1"){
			alert("编辑成功");
			location.reload();
		}else{
			alert("编辑失败");
		}
	},"json");
}
function addmuban6(){
	var x = $("#lygd").val().replace(/([\n]{1})/g,' ');
	var y = $("#ltypes").val();
	var id= $("#id").val();
	$.post("__APP__/system/editcanshu",{
		id: id,
		x : x,
		y : y
	}, function(data) {
		if(data.msg=="1"){
			alert("编辑成功");
			location.reload();
		}else{
			alert("编辑失败");
		}
	},"json");
}
function addmuban7(){
	var x = $("#weather").val();
	var y = '';
	var id= $("#id").val();

	$.post("__APP__/system/editcanshu",{
		id: id,
		x : x,
		y : y
	}, function(data) {
		if(data.msg=="1"){
			alert("编辑成功");
			location.reload();
		}else{
			alert("编辑失败");
		}
	},"json");
}
function addmuban8(){
	var x = $("#logo").val();
	var y = '';
	var id= $("#id").val();
	$.post("__APP__/system/editcanshu",{
		id: id,
		x : x,
		y : y
	}, function(data) {
		if(data.msg=="1"){
			alert("编辑成功");
			location.reload();
		}else{
			alert("编辑失败");
		}
	},"json");
}
</script>
</head>

<body>
<input type="hidden" id="id" name="id"></td>
{include file="public/head"}
 <div class="content_TX"><img src="__PUBLIC__/images/touxiang.png"></div>
</div>
<div class="content_2 clear">
{include file="system/left"}
<div class="content_3 left">
  <div class="content_3_wz"><img src="__PUBLIC__/images/dajt.png" />系统维护 &gt; 参数设置</div>

  <table width="100%" border="0" cellpadding="0" class="content_bg">
   <thead >
      <tr>
        <td width="10%" >编号</td>
        <td width="31%" >名称</td>
        <td width="24%" >top值</td>
        <td width="23%" >left值</td>
        <td width="12%" >操作</td>
      </tr>
    </thead>
    <tbody>
      <?php
      foreach($row as $val){
      ?>
      <tr  >
        <td>{$val[id]}</td>
        <td>{$val[name]}</td>
        <td>{$val[x]}</td>
        <td>{$val[y]}</td>
        <td><a href="#" class="layui-btn layui-btn-sm"onclick="edit('{$val[name]}','{$val[x]}','{$val[y]}','{$val[id]}')">修改</a></td>
      </tr>
      <?php
       }
      ?>
    </tbody>
  </table>

<div id="edit" style="DISPLAY:none" class="show">
  <table width="500px" border="0" align="center"  cellpadding="0" bgcolor="#FFFFFF" style="text-align:center; border:1px solid #e4e4e4;">
   <thead >
      <tr>
        <td colspan="2">参数信息</td>
      </tr>
    </thead>
    <tbody>
      <tr class="ctt_gr">
        <td width="276" align="right">参数名称：</td>
        <td width="316" align="left"><span id="name"></span>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td align="right">top&nbsp;&nbsp;&nbsp;&nbsp;值：</td>
        <td align="left"><input class="textField_hp1" size="15" type="text" id="x" /></td>
      </tr>
       <tr class="ctt_gr">
        <td align="right">left&nbsp;&nbsp;&nbsp;&nbsp;值：</td>
        <td align="left"><input class="textField_hp1" size="15" type="text" id="y" /></td>
      </tr>

      <tr class="ctt_gr">
        <td colspan="2" align="center"><input name="submit2" type="button" value="确定" border="0"  onClick="editad()" class="layui-btn"/>
            <input name="submit22" type="submit" value="取消" border="0" method="post"  class="layui-btn layui-btn-warm" onclick="document.getElementById
('edit').style.display='none'"/>
        </td>
      </tr>
    </tbody>
  </table>
</div>

<div id="editmuban" style="DISPLAY:none" class="show">
  <table width="500px" border="0" align="center"  cellpadding="0" bgcolor="#FFFFFF" style="text-align:center; border:1px solid #e4e4e4;">
   <thead >
      <tr>
        <td colspan="2">参数信息</td>
      </tr>
    </thead>
    <tbody>
      <tr class="ctt_gr">
        <td width="276" align="right">名称：</td>
        <td width="316" align="left"><span id="mubanname"></span>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td align="right">模板：</td>
        <td align="left">
        	<select id="muban">
        		<option value="默认">默认</option>
        		<option value="十个pad">十个pad</option>
        	</select>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td colspan="2" align="center"><input name="submit2" type="button" value="确定" border="0"  onClick="addmuban()" class="layui-btn"/>
            <input name="submit22" type="submit" value="取消" border="0" method="post"  class="layui-btn layui-btn-warm" onclick="document.getElementById
('editmuban').style.display='none'"/>
        </td>
      </tr>
    </tbody>
  </table>
</div>

<div id="editweather" style="DISPLAY:none" class="show">
  <table width="500px" border="0" align="center"  cellpadding="0" bgcolor="#FFFFFF" style="text-align:center; border:1px solid #e4e4e4;">
   <thead >
      <tr>
        <td colspan="2">参数信息</td>
      </tr>
    </thead>
    <tbody>
      <tr class="ctt_gr">
        <td width="276" align="right">名称：</td>
        <td width="316" align="left"><span id="weathername"></span>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td align="right">模板：</td>
        <td align="left">
        	<select id="weather">
        		<option value="默认">默认</option>
        		<option value="隐藏">隐藏</option>
        	</select>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td colspan="2" align="center"><input name="submit2" type="button" value="确定" border="0"  onClick="addmuban7()" class="layui-btn"/>
            <input name="submit22" type="submit" value="取消" border="0" method="post"  class="layui-btn layui-btn-warm" onclick="document.getElementById
('editweather').style.display='none'"/>
        </td>
      </tr>
    </tbody>
  </table>
</div>


<div id="editlogo" style="DISPLAY:none" class="show">
  <table width="500px" border="0" align="center"  cellpadding="0" bgcolor="#FFFFFF" style="text-align:center; border:1px solid #e4e4e4;">
   <thead >
      <tr>
        <td colspan="2">参数信息</td>
      </tr>
    </thead>
    <tbody>
      <tr class="ctt_gr">
        <td width="276" align="right">名称：</td>
        <td width="316" align="left"><span id="logoname"></span>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td align="right">选择：</td>
        <td align="left">
        	<select id="logo">
        		<option value="默认">默认</option>
        		<option value="other">other</option>
        		<option value="隐藏">隐藏</option>
        	</select>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td colspan="2" align="center"><input name="submit2" type="button" value="确定" border="0"  onClick="addmuban8()" class="layui-btn"/>
            <input name="submit22" type="submit" value="取消" border="0" method="post"  class="layui-btn layui-btn-warm" onclick="document.getElementById
('editlogo').style.display='none'"/>
        </td>
      </tr>
    </tbody>
  </table>
</div>


  <div id="editlygd" style="DISPLAY:none" class="show">
  <table width="500px" border="0" align="center"  cellpadding="0" bgcolor="#FFFFFF" style="text-align:center; border:1px solid #e4e4e4;">
   <thead >
      <tr>
        <td colspan="2">参数信息</td>
      </tr>
    </thead>
    <tbody>
      <tr class="ctt_gr">
        <td width="276" align="right">名称：</td>
        <td width="316" align="left"><span id="lygdname"></span>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td align="right">留言：</td>
        <td align="left">
        	<textarea id="lygd" name="con"  cols ="30" rows = "5"></textarea>
        </td>
      </tr>
      <tr class="ctt_gr">
          <td align="right">属性：</td>
          <td align="left"><label>
              <select id="ltypes"  name="ltypes">
                  <option value=1>&nbsp;中文&nbsp;</option>
                  <option value=2>&nbsp;英文&nbsp;</option>
                  <option value=3>&nbsp;日文&nbsp;</option>
                  <option value=4>&nbsp;韩文&nbsp;</option>
              </select>
          </label>
              &nbsp;</td>
      </tr>
      <tr class="ctt_gr">
        <td colspan="2" align="center"><input name="submit2" type="button" value="确定" border="0"  onClick="addmuban6()" class="layui-btn"/>
            <input name="submit22" type="submit" value="取消" border="0" method="post"  class="layui-btn layui-btn-warm" onclick="document.getElementById
('editlygd').style.display='none'"/>
        </td>
      </tr>
    </tbody>
  </table>
</div>
<div id="editkf" style="DISPLAY:none" class="show">
  <table width="500px" border="0" align="center"  cellpadding="0" bgcolor="#FFFFFF" style="text-align:center; border:1px solid #e4e4e4;">
   <thead >
      <tr>
        <td colspan="2">参数信息</td>
      </tr>
    </thead>
    <tbody>
      <tr class="ctt_gr">
        <td width="276" align="right">名称：</td>
        <td width="316" align="left"><span id="kfname"></span>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td align="right">模板：</td>
        <td align="left">
        	<select id="kf">
        		<option value="默认">默认</option>
        		<option value="手动">手动</option>
        		<option value="自动">自动</option>
        	</select>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td colspan="2" align="center"><input name="submit2" type="button" value="确定" border="0"  onClick="addmuban1()" class="layui-btn"/>
            <input name="submit22" type="submit" value="取消" border="0" method="post"  class="layui-btn layui-btn-warm" onclick="document.getElementById
('editkf').style.display='none'"/>
        </td>
      </tr>
    </tbody>
  </table>
</div>
<div id="editkaiji" style="DISPLAY:none" class="show">
  <table width="500px" border="0" align="center"  cellpadding="0" bgcolor="#FFFFFF" style="text-align:center; border:1px solid #e4e4e4;">
   <thead >
      <tr>
        <td colspan="2">参数信息</td>
      </tr>
    </thead>
    <tbody>
      <tr class="ctt_gr">
        <td width="276" align="right">名称：</td>
        <td width="316" align="left"><span id="kaijiname"></span>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td align="right">选择：</td>
        <td align="left">
        	<select id="kaiji">
        		<option value="默认">默认</option>
        		<option value="视频1强制">视频1强制</option>
        		<option value="视频1">视频1</option>
        		<option value="视频2强制">视频2强制</option>
        		<option value="视频2">视频2</option>
        		<option value="全部显示强制">全部显示强制</option>
        		<option value="全部显示">全部显示</option>
        		<option value="视频1强制视频2">视频1强制视频2</option>
        		<option value="视频1视频2强制">视频1视频2强制</option>
        	</select>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td colspan="2" align="center"><input name="submit2" type="button" value="确定" border="0"  onClick="addmuban3()" class="layui-btn"/>
            <input name="submit22" type="submit" value="取消" border="0" method="post"  class="layui-btn layui-btn-warm" onclick="document.getElementById
('editkaiji').style.display='none'"/>
        </td>
      </tr>
    </tbody>
  </table>
</div>
<div id="editds" style="DISPLAY:none" class="show">
  <table width="500px" border="0" align="center"  cellpadding="0" bgcolor="#FFFFFF" style="text-align:center; border:1px solid #e4e4e4;">
   <thead >
      <tr>
        <td colspan="2">参数信息</td>
      </tr>
    </thead>
    <tbody>
      <tr class="ctt_gr">
        <td width="276" align="right">名称：</td>
        <td width="316" align="left"><span id="dsname"></span>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td align="right">选择：</td>
        <td align="left">
        	<select id="ds">
        		<option value="弹出">弹出</option>
        		<option value="滚动">滚动</option>
        	</select>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td colspan="2" align="center"><input name="submit2" type="button" value="确定" border="0"  onClick="addmuban5()" class="layui-btn"/>
            <input name="submit22" type="submit" value="取消" border="0" method="post"  class="layui-btn layui-btn-warm" onclick="document.getElementById
('editds').style.display='none'"/>
        </td>
      </tr>
    </tbody>
  </table>
</div>
<div id="editandriod" style="DISPLAY:none" class="show">
  <table width="500px" border="0" align="center"  cellpadding="0" bgcolor="#FFFFFF" style="text-align:center; border:1px solid #e4e4e4;">
   <thead >
      <tr>
        <td colspan="2">参数信息</td>
      </tr>
    </thead>
    <tbody>
      <tr class="ctt_gr">
        <td width="276" align="right">名称：</td>
        <td width="316" align="left"><span id="andriodname"></span>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td align="right">选择：</td>
        <td align="left">
        	<select id="andriod">
        		<option value="默认">默认</option>
        		<option value="Andriod">Andriod</option>
        		<option value="PC">PC</option>
        	</select>
        </td>
      </tr>
      <tr class="ctt_gr">
        <td colspan="2" align="center"><input name="submit2" type="button" value="确定" border="0"  onClick="addmuban4()" class="layui-btn"/>
            <input name="submit22" type="submit" value="取消" border="0" method="post"  class="layui-btn layui-btn-warm" onclick="document.getElementById
('editandriod').style.display='none'"/>
        </td>
      </tr>
    </tbody>
  </table>
</div>


  <div id="editempty" style="DISPLAY:none" class="show">
  <table width="500px" border="0" align="center"  cellpadding="0" bgcolor="#FFFFFF" style="text-align:center; border:1px solid #e4e4e4;">
   <thead >
      <tr>
        <td colspan="2">参数信息</td>
      </tr>
    </thead>
    <tbody>
      <tr class="ctt_gr">
        <td width="276" align="right">参数名称：</td>
        <td width="316" align="left"><span id="nameempty"></span></td>
      </tr>
	     <tr class="ctt_gr">
        <td  colspan= "2">
			<input type="radio" name="radiobutton" value="0" checked>收费
			<input type="radio" name="radiobutton" value="0"> 不收费
		</td>
      </tr>

      <tr class="ctt_gr">
        <td colspan="2" align="center"><input name="submit2" type="button" value="确定" border="0"  onClick="editad()" class="layui-btn"/>
            <input name="submit22" type="submit" value="取消" border="0" method="post"  class="layui-btn layui-btn-warm" onclick="document.getElementById
('editempty').style.display='none'"/>
        </td>
      </tr>
    </tbody>
  </table>
</div>
</div>


<div id="editpd" style="DISPLAY:none" class="show">
    <table width="500px" border="0" align="center"  cellpadding="0" bgcolor="#FFFFFF" style="text-align:center; border:1px solid #e4e4e4;">
       <thead >
        <tr>
            <td colspan="2">参数信息</td>
        </tr>
        </thead>
        <tbody>
        <tr class="ctt_gr">
            <td width="276" align="right">名称：</td>
            <td width="316" align="left"><span id="pdname"></span>
            </td>
        </tr>
        <tr class="ctt_gr">
            <td align="right">模板：</td>
            <td align="left">
                <select id="pd">
                    <option value="-1">默认</option>
                    <?php
                 if(!empty($app)){
        			 foreach($app as $val){
				?>
                    <option value="{$val['id']}">{$val['name']}</option>
                    <?php
					    }
					}
        		?>
                </select>
            </td>
        </tr>
        <tr class="ctt_gr">
            <td colspan="2" align="center"><input name="submit2" type="button" value="确定" border="0"  onClick="addmuban2()" class="layui-btn"/>
                <input name="submit22" type="submit" value="取消" border="0" method="post"  class="layui-btn layui-btn-warm" onclick="document.getElementById
('editpd').style.display='none'"/>
            </td>
        </tr>
        </tbody>
    </table>
</div>


</body>
</html>
